import service from "../utils/request";

// 获取商品列表
export const getGoodsListAPI = (params) => {
    return service.get('/api/good/page', { params })
}

// 新增商品
export const addGoodsAPI = (data) => {
    return service.post('/api/good', data)
}

// 删除
export const deleteGoodsAPI = (id) => {
    return service.delete(`/api/good/${id}`)
}

// 通过id获取
export const getGoodsByIdAPI = (id) => {
    return service.get(`/api/good/${id}`)
}

// 更新
export const updateGoodsAPI = (data) => {
    return service.put('/api/good', data)
}